//package com.youhui.weixin.controller.interceptor;
//
//import org.springframework.web.servlet.ModelAndView;
//import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * Created by https://github.com/kuangcp on 17-10-11  下午2:43
// */
//public class AdminInterceptor extends HandlerInterceptorAdapter {
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        Long startTime = System.currentTimeMillis();
//        System.out.println(request.getRequestURL());
//
//        request.setAttribute("startTime",startTime);
//        return true;
//    }
//
//    @Override
//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
//        long startTime = (Long)request.getAttribute("startTime");
//        request.removeAttribute("startTime");
//        Long endTime = System.currentTimeMillis();
//        System.out.println(request.getRequestURL()+"发起请求耗时:[ "+ (endTime - startTime) +"  ms]");
//    }
//}
